﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ledict.ConditionExtract.Common
{
    public static class Log
    {
        static private string path =  "D:\\log.txt";
        public static void WriteLog(string msg)
        {
            try
            {
                new Loger().Info(msg);

                //string dateTime = System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                //File.AppendAllText(path, dateTime + "\r\n");
                //File.AppendAllText(path, msg + "\r\n");
                //Console.WriteLine(dateTime);
                //Console.WriteLine(msg);
            }
            catch (Exception ex)
            {
                new Loger().Error(ex.Message); ;
                //string dateTime = System.DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
                //Console.WriteLine(dateTime);
                //Console.WriteLine(msg);
                //Console.WriteLine(ex.Message);
            }
        }

        public static void ErrorLog(string msg)
        {
            new Loger().Error(msg);
        }
    }
}
